//
//  RequestData.m
//  UESTCPioneer
//
//  Created by Sway on 14-3-29.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "RequestData.h"



@implementation RequestData

//分院请求数据
+(NSDictionary*)CollegeRequestDataWithCode:(NSString*)collegeCodeString{
    return @{@"type":@"getYuanNews",@"yuanCode":collegeCodeString,@"page":@"1"};
}

//“全部”新闻请求数据
+(NSDictionary*)AllNewsRequestData{
  return @{@"type":@"getNews",@"page":@"1"};
}


///level:为0，1、2、3分别代表校级通知、院级、支部、全部通知；
+(NSDictionary*)NoticeDataWithLevel:(NSInteger)level{
        return @{@"type":@"getNoticeOrAnnounce"
                  ,@"userId":[constant getUserId]
                  ,@"userName":[constant getUserName]
                  ,@"page":@"1"
                  ,@"typepid":@"1"
                  ,@"level":[NSString stringWithFormat:@"%d",level]};
}

+(NSDictionary*)ActivityDataWithTypeName:(NSString*)type{
    
    
//    if ([type isEqualToString:@"可报名"])
    if ([type isEqualToString:@"最新"])
        return @{@"type":@"getEvent",@"userId":[constant getUserId],@"page":@"1"};
    else if ([type isEqualToString:@"热门"])
        return @{@"type":@"sortEvent",@"userId":[constant getUserId],@"page":@"1"};
    return  nil;
}
+(NSDictionary*)CollegeActivityDataWithTypeName:(NSString*)collegeId{
//    http://localhost:8080/ScienceApp/ieaction.do?type=getEvent_College&userId=&userName=&collegeid=&page=
    return @{@"type":@"getEvent_College",@"userId":[constant getUserId],@"userName":[constant getUserName],@"collegeid":collegeId,@"page":@"1"};
}



//个人管理模块请求数据
+ (NSDictionary *)sendBirthCareRequestDataWithForuserid:(NSUInteger)foruserid
{
    return @{
             @"type":@"lifecareBless",
             @"userId":[constant getUserId],
             @"typepid":@"sendbless",
             @"userName":[constant getUserName],
             @"foruserid":[NSString stringWithFormat:@"%D",foruserid]
             };
}

+ (NSDictionary *)getListOfBirthRequestDataWithPage:(NSUInteger)page
{
    return @{
             @"type":@"lifecareBless",
             @"userId":[constant getUserId],
             @"typepid":@"blesslist",
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)sendNoticeRequestDataWithContent:(NSString *)content
{
    return @{
             @"type":@"writeNoticeOrAnnounce",
             @"typepid":@"1",
             @"userId":[constant getUserId],
             @"userName":[constant getUserName],
             @"content":content,
             };
}

+ (NSDictionary *)startActivityRequestDataWithContent:(NSString *)content title:(NSString *)title
{
    return @{
             @"type":@"EventPublish",
             @"userName":[constant getUserName],
             @"userId":[constant getUserId],
             @"content":content,
             @"eventTitle":title
             };
}

+ (NSDictionary *)getDailyCareRequestDataWithPage:(NSUInteger)page
{
    return @{
             @"type":@"lifecareBless",
             @"typepid":@"lifecarelist",
             @"userId":[constant getUserId],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)sendDailyCareRequestDataWithContent:(NSString *)content
{
    return @{
             @"type":@"lifecareBless",
             @"typepid":@"sendlifecare",
             @"userId":[constant getUserId],
             @"userName":[constant getUserName],
             @"content":content,
             };
}

+ (NSDictionary *)getCollectionRequestDataWithPage:(NSUInteger)page;
{
    return @{
             @"type":@"perAdminNotice",
             @"typepid":@"1",
             @"userId":[constant getUserId],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)getListOfMessageRequestDataWithPage:(NSUInteger)page
{
    return @{
             @"type":@"msgRemind",
             @"userId":[constant getUserId],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)getSpecialMessageRequestDataWithMsgid:(NSUInteger)msgid
{
    return @{
             @"type":@"msgRemind",
             @"userId":[constant getUserId],
             @"typepid":@"bless",
             @"id":[NSString stringWithFormat:@"%d",msgid],
             };
}

+ (NSDictionary *)getListOfNoticeRequestDataWithPage:(NSUInteger)page
{
    return @{
             @"type":@"perAdminNotice",
             @"typepid":@"0",
             @"userId":[constant getUserId],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)getListOfAnnounceRequestDataWithPage:(NSUInteger)page
{
    return @{
             @"type":@"perAdminAnnounce",
             @"typepid":@"getAnnnouncelist",
             @"userId":[constant getUserId],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)getAnnounceContentRequestDataWithAnnounceid:(NSUInteger)announceid
{
    return @{
             @"type":@"perAdminNotice",
             @"noticeid":[NSString stringWithFormat:@"%d",announceid],
             };
}

+ (NSDictionary *)getAnnnounceProposalRequestDataWithAnnounceid:(NSUInteger)announceid page:(NSUInteger)page
{
    return @{
             @"type":@"perAdminAnnounce",
             @"typepid":@"getAnnnounceProposal",
             @"userId":[constant getUserId],
             @"announceid":[NSString stringWithFormat:@"%d",announceid],
             @"page":[NSString stringWithFormat:@"%d",page],
             };
}

+ (NSDictionary *)getPerAdminNoticeRequestDataWithNoticeid:(NSUInteger)noticeid
{
    return @{
             @"type":@"perAdminNotice",
             @"noticeid":[NSString stringWithFormat:@"%d",noticeid],
             };
}

+ (NSDictionary *)changePersonalInformationRequestDataWithNickname:(NSString *)Nickname withName:(NSString *)name withSex:(NSString *)sex withNation:(NSString *)nation withHometown:(NSString *)hometown withOldPassword:(NSString *)oldpassword withNewPassword:(NSString *)newpassword
{
    NSLog(@"nickname = %@ id = %@ name=%@ sex=%@ nation=%@ hometown=%@ oldPassword=%@ newPassword=%@",Nickname,[constant getIndexId], name, sex, nation, hometown ,oldpassword, newpassword);
    
    if (newpassword.length<=0||[newpassword isEqualToString:@""]||newpassword == nil) {
        return @{
                 @"id":[constant getIndexId],
                 @"oldPwd":oldpassword,
                 @"newPwd":oldpassword,
                 @"name":[helper urlencode :name],
                 @"nation":[helper urlencode:nation],
                 @"hometown":[helper urlencode:hometown],
                 @"sex":[helper urlencode :sex],
                 @"userName":Nickname,
                 };
    }else{
        return @{
                 @"id":[constant getIndexId],
                 @"oldPwd":oldpassword,
                 @"name":[helper urlencode :name],
                 @"nation":[helper urlencode:nation],
                 @"hometown":[helper urlencode:hometown],
                 @"sex":[helper urlencode :sex],
                 @"userName":Nickname,
                 @"newPwd":newpassword,
                 };
    }
    
}

@end
